Skip to content

Conversation

@JoeRobich
Copy link
Member

@JoeRobich JoeRobich commented Jul 10, 2024

Adds the ability to select a document's project context. Uses the key added in dotnet/roslyn#81940 to ensure all documents that have the same set of contexts use the same active context.

  • Updates Roslyn to bring in new refresh handler and project context list key
  • Adds select project context command
  • Adds the select command to the Project Context status item
  • Updates middleware to send selected context with server requests
  • Sends a provider refresh notification when selected context is changed
Screen.Recording.2026-01-12.at.11.13.23.PM.mov
See all Roslyn changes...

View Complete Diff of Changes

  • Add a notification handler for project context changed. (PR: #81942)
  • Ensure IDE does not use .editorconfig for source generated files (PR: #81911)
  • Send a key across identifying contents of the project context list (PR: #81940)
  • Include document path in InvalidOperationException when document not found (PR: #81969)
  • Include Enc diagnostics in Razor requests (PR: #81941)
  • Fix completions after attribute list in lambdas (PR: #81961)

"Open solution": "Open solution",
"Select context": "Select context",
"C# Project Context Status": "C# Project Context Status",
"Active File Context": "Active File Context",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering - could we merge this into the select button?
e.g.
ProjectA (net6.0) Change Active File Context

or maybe we could even put the document name in it?
ProjectA (net6.0) Change Program.cs Context

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, although the select command is only visible when there are multiple project contexts. Would it be jarring for the text to move from the item details to the command and back again as you navigate?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah hmm. I wonder if we should just always show the button even if there's only one. Not sure

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should get it into preview in its current form and work out user experiences issues from there.

@JoeRobich JoeRobich force-pushed the dev/jorobich/select-project-context branch 2 times, most recently from 6ca46de to 44b576a Compare July 11, 2024 07:24
@JoeRobich JoeRobich force-pushed the dev/jorobich/select-project-context branch from 44b576a to ee62554 Compare December 11, 2024 08:13
@JoeRobich JoeRobich force-pushed the dev/jorobich/select-project-context branch from ee62554 to 0865483 Compare January 9, 2026 04:32
- Adds select project context commands
- Adds the select command to the Project Context status item
- Updates middleware to send selected context with server requests.
@JoeRobich JoeRobich force-pushed the dev/jorobich/select-project-context branch from 0865483 to 21ed6a9 Compare January 12, 2026 21:56
@JoeRobich JoeRobich marked this pull request as ready for review January 13, 2026 00:51
@JoeRobich JoeRobich requested a review from a team as a code owner January 13, 2026 00:51
* Handle conflict markers (PR: [#12642](https://github.com/dotnet/razor/pull/12642))
* Fix cross project span and edit mapping (PR: [#12614](https://github.com/dotnet/razor/pull/12614))
* Update Roslyn to 5.4.0-2.26060.1 (PR: [#8877](https://github.com/dotnet/vscode-csharp/pull/8877))
* Filter our html diagnostics when a tag helper attribute spans multiple lines (PR: [#12654](https://github.com/dotnet/razor/pull/12654))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed some trailing whitespace from Razor entries.

@JoeRobich JoeRobich merged commit 1cbc23f into main Jan 14, 2026
33 checks passed
@JoeRobich JoeRobich deleted the dev/jorobich/select-project-context branch January 14, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants